<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
    
  
  <link href="//cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.4.1/dist/jquery.fancybox.min.css" rel="stylesheet" type="text/css">




  
  
  
  

  

  

  

  
    

    
  

  

  
    
    
    <link href="//fonts.loli.net/css?family=Damion:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/blog/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/blog/css/main.css?v=6.6.0" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png?v=6.6.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png?v=6.6.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png?v=6.6.0">


  <link rel="mask-icon" href="/blog/images/logo.svg?v=6.6.0" color="#222">









<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/blog/',
    scheme: 'Gemini',
    version: '6.6.0',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":true,"onmobile":false},
    fancybox: true,
    fastclick: false,
    lazyload: true,
    tabs: true,
    motion: {"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>


  




  <meta name="description" content="前期准备服务器安装 Docker 和 Docker Compose 参考教程：http://get.daocloud.io/#install-docker 没有服务器的可以在本地安装 Docker 或使用 DaoCloud 的胶囊主机, 能免费体验 120 分钟，足够学习使用 路径：自有主机 -&amp;gt; 集群管理 -&amp;gt; 添加主机">
<meta name="keywords" content="Docker,Linux">
<meta property="og:type" content="article">
<meta property="og:title" content="使用Docker部署FlarumChina">
<meta property="og:url" content="https://raincal.gitee.io/blog/post/deploy-flarumchina-with-docker/index.html">
<meta property="og:site_name" content="Raincal&#39;s Blog">
<meta property="og:description" content="前期准备服务器安装 Docker 和 Docker Compose 参考教程：http://get.daocloud.io/#install-docker 没有服务器的可以在本地安装 Docker 或使用 DaoCloud 的胶囊主机, 能免费体验 120 分钟，足够学习使用 路径：自有主机 -&amp;gt; 集群管理 -&amp;gt; 添加主机">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic01.png">
<meta property="og:image" content="https://cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic02.png">
<meta property="og:image" content="https://cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic03.png">
<meta property="og:image" content="https://cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic05.png">
<meta property="og:updated_time" content="2018-09-01T09:33:26.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="使用Docker部署FlarumChina">
<meta name="twitter:description" content="前期准备服务器安装 Docker 和 Docker Compose 参考教程：http://get.daocloud.io/#install-docker 没有服务器的可以在本地安装 Docker 或使用 DaoCloud 的胶囊主机, 能免费体验 120 分钟，足够学习使用 路径：自有主机 -&amp;gt; 集群管理 -&amp;gt; 添加主机">
<meta name="twitter:image" content="https://cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic01.png">



  <link rel="alternate" href="/blog/atom.xml" title="Raincal's Blog" type="application/atom+xml">




  <link rel="canonical" href="https://raincal.gitee.io/blog/post/deploy-flarumchina-with-docker/">



<script type="text/javascript" id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  <title>使用Docker部署FlarumChina | Raincal's Blog</title>
  




<script async src="https://www.googletagmanager.com/gtag/js?id=UA-89637345-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-89637345-1');
</script>








  <noscript>
  <style type="text/css">
    .use-motion .motion-element,
    .use-motion .brand,
    .use-motion .menu-item,
    .sidebar-inner,
    .use-motion .post-block,
    .use-motion .pagination,
    .use-motion .comments,
    .use-motion .post-header,
    .use-motion .post-body,
    .use-motion .collection-title { opacity: initial; }

    .use-motion .logo,
    .use-motion .site-title,
    .use-motion .site-subtitle {
      opacity: initial;
      top: initial;
    }

    .use-motion {
      .logo-line-before i { left: initial; }
      .logo-line-after i { right: initial; }
    }
  </style>
</noscript>

</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/blog/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Raincal's Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
    
      
    

    

    <a href="/blog/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
    
      
    

    

    <a href="/blog/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
    
      
    

    

    <a href="/blog/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
    
      
    

    

    <a href="/blog/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-photos">

    
    
    
      
    

    

    <a href="/blog/photos/" rel="section"><i class="menu-item-icon fa fa-fw fa-camera-retro"></i> <br>photos</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



  



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://raincal.gitee.io/blog/blog/post/deploy-flarumchina-with-docker/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Raincal">
      <meta itemprop="description" content="El Psy Congroo">
      <meta itemprop="image" content="https://cdn-1256167913.image.myqcloud.com/images/avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Raincal's Blog">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">使用Docker部署FlarumChina
              
            
          </h2>
        

        <div class="post-meta">
          <span class="post-time">

            
            
            

            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2017-08-07 10:49:51" itemprop="dateCreated datePublished" datetime="2017-08-07T10:49:51+08:00">2017-08-07</time>
            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="前期准备"><a href="#前期准备" class="headerlink" title="前期准备"></a>前期准备</h2><p>服务器安装 Docker 和 Docker Compose</p>
<p>参考教程：<br><a href="http://get.daocloud.io/#install-docker" target="_blank" rel="noopener">http://get.daocloud.io/#install-docker</a></p>
<p>没有服务器的可以在本地安装 Docker 或使用 DaoCloud 的胶囊主机, 能免费体验 120 分钟，足够学习使用</p>
<p>路径：自有主机 -&gt; 集群管理 -&gt; 添加主机</p>
<img src="//cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic01.png" alt="深度截图_选择区域_20170807083400">
<a id="more"></a>
<h2 id="安装-Flarum"><a href="#安装-Flarum" class="headerlink" title="安装 Flarum"></a>安装 Flarum</h2><p>我们使用到的镜像是 <a href="https://github.com/Raincal/docker-flarum-china" target="_blank" rel="noopener">raincal/docker-flarum-china</a></p>
<h3 id="Ports"><a href="#Ports" class="headerlink" title="Ports"></a>Ports</h3><p><code>8888</code></p>
<h3 id="Volume"><a href="#Volume" class="headerlink" title="Volume"></a>Volume</h3><ul>
<li>/flarum/app/assets : FlarumChina 资源目录</li>
<li>/flarum/app/extensions : FlarumChina 插件目录</li>
</ul>
<h3 id="环境变量"><a href="#环境变量" class="headerlink" title="环境变量"></a>环境变量</h3><table>
<thead>
<tr>
<th>变量</th>
<th>描述</th>
<th>类型</th>
<th>默认值</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>UID</strong></td>
<td>Flarum user id</td>
<td><em>optional</em></td>
<td>991</td>
</tr>
<tr>
<td><strong>GID</strong></td>
<td>Flarum group id</td>
<td><em>optional</em></td>
<td>991</td>
</tr>
<tr>
<td><strong>DEBUG</strong></td>
<td>Flarum debug mode</td>
<td><em>optional</em></td>
<td>false</td>
</tr>
<tr>
<td><strong>FORUM_URL</strong></td>
<td>Forum URL</td>
<td><strong>required</strong></td>
<td>none</td>
</tr>
<tr>
<td><strong>DB_HOST</strong></td>
<td>MariaDB instance ip/hostname</td>
<td><em>optional</em></td>
<td>mariadb</td>
</tr>
<tr>
<td><strong>DB_USER</strong></td>
<td>MariaDB database username</td>
<td><em>optional</em></td>
<td>flarum</td>
</tr>
<tr>
<td><strong>DB_NAME</strong></td>
<td>MariaDB database name</td>
<td><em>optional</em></td>
<td>flarum</td>
</tr>
<tr>
<td><strong>DB_PASS</strong></td>
<td>MariaDB database password</td>
<td><strong>required</strong></td>
<td>none</td>
</tr>
<tr>
<td><strong>DB_PREF</strong></td>
<td>Flarum tables prefix</td>
<td><em>optional</em></td>
<td>none</td>
</tr>
<tr>
<td><strong>UPLOAD_MAX_SIZE</strong></td>
<td>The maximum size of an uploaded file</td>
<td><em>optional</em></td>
<td>50M</td>
</tr>
<tr>
<td><strong>MEMORY_LIMIT</strong></td>
<td>maximum amount of memory used by php</td>
<td><em>optional</em></td>
<td>128M</td>
</tr>
</tbody>
</table>
<h3 id="编写-docker-compose-yml-文件"><a href="#编写-docker-compose-yml-文件" class="headerlink" title="编写 docker-compose.yml 文件"></a>编写 docker-compose.yml 文件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">mkdir flarum &amp;&amp; <span class="built_in">cd</span> flarum</span><br><span class="line">vi docker-compose.yml</span><br></pre></td></tr></table></figure>
<p>根据自身情况 修改</p>
<p>FORUM_URL</p>
<p>DB_PASS</p>
<p>MYSQL_ROOT_PASSWORD</p>
<p>MYSQL_PASSWORD</p>
<p>等环境变量</p>
<figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">flarum:</span></span><br><span class="line"><span class="attr">  image:</span> <span class="string">raincal/docker-flarum-china:0.1.0-beta.7-stable</span></span><br><span class="line"><span class="attr">  container_name:</span> <span class="string">flarum</span></span><br><span class="line"><span class="attr">  links:</span></span><br><span class="line"><span class="attr">    - mariadb:</span><span class="string">mariadb</span></span><br><span class="line"><span class="attr">  environment:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">FORUM_URL=https://forum.domain.tld</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">DB_PASS=123456</span></span><br><span class="line"><span class="attr">  volumes:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/flarum/assets:/flarum/app/assets</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/flarum/extensions:/flarum/app/extensions</span></span><br><span class="line"></span><br><span class="line"><span class="attr">mariadb:</span></span><br><span class="line"><span class="attr">  image:</span> <span class="attr">mariadb:10.1</span></span><br><span class="line"><span class="attr">  container_name:</span> <span class="string">mariadb</span></span><br><span class="line"><span class="attr">  volumes:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/mysql/db:/var/lib/mysql</span></span><br><span class="line"><span class="attr">  environment:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">MYSQL_ROOT_PASSWORD=123456</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">MYSQL_DATABASE=flarum</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">MYSQL_USER=flarum</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">MYSQL_PASSWORD=123456</span></span><br><span class="line"></span><br><span class="line"><span class="attr">nginx:</span></span><br><span class="line"><span class="attr">  image:</span> <span class="string">wonderfall/boring-nginx</span></span><br><span class="line"><span class="attr">  container_name:</span> <span class="string">nginx</span></span><br><span class="line"><span class="attr">  links:</span></span><br><span class="line"><span class="attr">    - flarum:</span><span class="string">flarum</span></span><br><span class="line"><span class="attr">  ports:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">"80:8000"</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">"443:4430"</span></span><br><span class="line"><span class="attr">  volumes:</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/nginx/sites-enabled:/sites-enabled</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/nginx/conf:/conf.d</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/nginx/log:/var/log/nginx</span></span><br><span class="line"><span class="bullet">    -</span> <span class="string">/mnt/docker/nginx/certs:/certs</span></span><br></pre></td></tr></table></figure>
<h3 id="启动应用"><a href="#启动应用" class="headerlink" title="启动应用"></a>启动应用</h3><p><code>docker-compose up -d</code></p>
<p>若使用胶囊主机，可以到 自有主机 -&gt; Stack -&gt; 创建新 Stack</p>
<img src="//cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic02.png" alt="深度截图_选择区域_20170807084450">
<h3 id="设置-nginx-反向代理"><a href="#设置-nginx-反向代理" class="headerlink" title="设置 nginx 反向代理"></a>设置 nginx 反向代理</h3><p>通过 ssh 连接到胶囊主机</p>
<p><code>ssh ubuntu@52.80.37.119</code></p>
<img src="//cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic03.png" alt="深度截图_选择区域_20170807093749">
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">docker <span class="built_in">exec</span> -it nginx ngxproxy</span><br><span class="line"></span><br><span class="line">Welcome to ngxproxy utility.</span><br><span class="line">We<span class="string">'re about to create a new virtual host (AKA server block).</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">Name: flarum</span></span><br><span class="line"><span class="string">Domain: forum.domain.tld</span></span><br><span class="line"><span class="string">Webroot (default is /):</span></span><br><span class="line"><span class="string">Container: flarum</span></span><br><span class="line"><span class="string">Port (default is 80): 8888</span></span><br><span class="line"><span class="string">HTTPS [y/n]: n</span></span><br><span class="line"><span class="string">Max body size in MB (integer/null): 50</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">Done! flarum.conf has been generated.</span></span><br><span class="line"><span class="string">Reload nginx now? [y/n]: y</span></span><br><span class="line"><span class="string">nginx successfully reloaded.</span></span><br></pre></td></tr></table></figure>
<p>完成后访问外网IP 52.80.37.119，本地环境的话访问 localhost 开始安装 flarum</p>
<p><strong>管理员密码需要大于8位</strong></p>
<img src="//cdn-1256167913.image.myqcloud.com/images/deploy-flarumChina-with-docker/pic05.png" alt="screencapture-54-222-128-207-1502096436141" class="imgurl">
      
    </div>

    
      

  <div class="popular-posts-header">相关文章</div>
  <ul class="popular-posts">
  
    <li class="popular-posts-item">
      
      
      <div class="popular-posts-title"><a href="/blog/post/gogs-share-22-port/" rel="bookmark">Gogs与主机共享22端口</a></div>
      
    </li>
  
    <li class="popular-posts-item">
      
      
      <div class="popular-posts-title"><a href="/blog/post/grub-rescue/" rel="bookmark">grub rescue模式下修复Linux引导</a></div>
      
    </li>
  
  </ul>


    

    
    
    

    

    
       
    
    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/blog/tags/Docker/" rel="tag"># Docker</a>
          
            <a href="/blog/tags/Linux/" rel="tag"># Linux</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/blog/post/lodash/" rel="next" title="10 个可用 ES6 替代的 Lodash 特性">
                <i class="fa fa-chevron-left"></i> 10 个可用 ES6 替代的 Lodash 特性
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/blog/post/vscode-icon-share/" rel="prev" title="VSCode icon 分享">
                VSCode icon 分享 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>


  </div>


          </div>
          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="https://cdn-1256167913.image.myqcloud.com/images/avatar.png" alt="Raincal">
            
              <p class="site-author-name" itemprop="name">Raincal</p>
              <p class="site-description motion-element" itemprop="description">El Psy Congroo</p>
          </div>

          
            <nav class="site-state motion-element">
              
                <div class="site-state-item site-state-posts">
                
                  <a href="/blog/archives/">
                
                    <span class="site-state-item-count">9</span>
                    <span class="site-state-item-name">日志</span>
                  </a>
                </div>
              

              
                
                
                <div class="site-state-item site-state-categories">
                  
                    
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">3</span>
                    <span class="site-state-item-name">分类</span>
                  
                </div>
              

              
                
                
                <div class="site-state-item site-state-tags">
                  <a href="/blog/tags/index.html">
                    
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                      
                    
                    <span class="site-state-item-count">17</span>
                    <span class="site-state-item-name">标签</span>
                  </a>
                </div>
              
            </nav>
          

          
            <div class="feed-link motion-element">
              <a href="/blog/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://github.com/Raincal" title="GitHub &rarr; https://github.com/Raincal" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://twitter.com/cyj228" title="Twitter &rarr; https://twitter.com/cyj228" rel="noopener" target="_blank"><i class="fa fa-fw fa-twitter"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://weibo.com/cyj228" title="Weibo &rarr; https://weibo.com/cyj228" rel="noopener" target="_blank"><i class="fa fa-fw fa-weibo"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="https://t.me/Raincal" title="Telegram &rarr; https://t.me/Raincal" rel="noopener" target="_blank"><i class="fa fa-fw fa-telegram"></i></a>
                </span>
              
                <span class="links-of-author-item">
                  
                  
                  
                    
                  
                  <a href="mailto:cyj94228@gmail.com" title="E-Mail &rarr; mailto:cyj94228@gmail.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i></a>
                </span>
              
            </div>
          

          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-block">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                Links
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="https://blog.raincal.com" title="https://blog.raincal.com" rel="noopener" target="_blank">RAINCAL</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://status.raincal.com" title="https://status.raincal.com" rel="noopener" target="_blank">UPTIME</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.fangr.cc" title="https://www.fangr.cc" rel="noopener" target="_blank">Fong Ray's Blog</a>
                  </li>
                
              </ul>
            </div>
          

          
            
          
          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前期准备"><span class="nav-number">1.</span> <span class="nav-text">前期准备</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#安装-Flarum"><span class="nav-number">2.</span> <span class="nav-text">安装 Flarum</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Ports"><span class="nav-number">2.1.</span> <span class="nav-text">Ports</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Volume"><span class="nav-number">2.2.</span> <span class="nav-text">Volume</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#环境变量"><span class="nav-number">2.3.</span> <span class="nav-text">环境变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#编写-docker-compose-yml-文件"><span class="nav-number">2.4.</span> <span class="nav-text">编写 docker-compose.yml 文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#启动应用"><span class="nav-number">2.5.</span> <span class="nav-text">启动应用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#设置-nginx-反向代理"><span class="nav-number">2.6.</span> <span class="nav-text">设置 nginx 反向代理</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      
        <div class="back-to-top">
          <i class="fa fa-arrow-up"></i>
          
            <span id="scrollpercent"><span>0</span>%</span>
          
        </div>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; 2015 – <span itemprop="copyrightYear">2018</span>
  <span class="with-love" id="animate">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Raincal</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a></div>




        








        
      </div>
    </footer>

    

    
	
    

    
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>







  






  















  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/jquery-lazyload@1.9.7/jquery.lazyload.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/velocity/1.2.3/velocity.ui.min.js"></script>
  

  
  
    <script type="text/javascript" src="//cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.4.1/dist/jquery.fancybox.min.js"></script>
  


  


  <script type="text/javascript" src="/blog/js/src/utils.js?v=6.6.0"></script>

  <script type="text/javascript" src="/blog/js/src/motion.js?v=6.6.0"></script>



  
  


  <script type="text/javascript" src="/blog/js/src/affix.js?v=6.6.0"></script>

  <script type="text/javascript" src="/blog/js/src/schemes/pisces.js?v=6.6.0"></script>



  
  <script type="text/javascript" src="/blog/js/src/scrollspy.js?v=6.6.0"></script>
<script type="text/javascript" src="/blog/js/src/post-details.js?v=6.6.0"></script>



  


  <script type="text/javascript" src="/blog/js/src/bootstrap.js?v=6.6.0"></script>



  



  










  





  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  
  

  

  

  

  

  

  

</body>
</html>
